<?php
function transaccionesI($query) {
	
		$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);

		if($mysqli->connect_error){
			die(" No se pudo conectar a la base de datos ");
		}

		$tam = count($query);
		$bool = true;
            
		
		$mysqli->autocommit(false);
	      
		for($i = 0; $i < $tam; $i++) {
	 
			if(!$mysqli->query($query[$i])) {
				$bool = false;
			}
		 
		 }
		
		if($bool){
		     					
			                           
                        $mysqli->commit();
		
			$mysqli->close();
                     
		
			return $bool;
		}else{
			
			
			$mysqli->rollback();
		
			$mysqli->close();
	 	
			return $bool;
		}

	}
?>
